<template>
  <div class="service">
    <div>
      <span>Main Services</span>
      <span>view all</span>
    </div>
    <ul class="service-ul">
      <ul v-for="item  in listServce" :key="item.service1">
        <li><span class="el-icon-headset"></span><span v-text="item.service1"></span></li>
        <li><span class="el-icon-headset"></span><span v-text="item.service2"></span></li>
      </ul>
    </ul>
  </div>
</template>
<script>
import store from '../store'
// 导入共享数据
import { mapState } from 'vuex'
export default {
  computed: {
    // 映射计算属性
    ...mapState(['listServce'])
  },
  store
}
</script>
<style lang="scss" scope>
.service {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -10px;
    span:first-child {
      font-weight: 700;
      font-size: 16px;
    }
    span:nth-last-child(1) {
      font-size: 12px;
      color: #ccc;
    }
  }
  ul{
    margin: 0;
    padding: 0;
    width: 100%;
  }
  ul.service-ul ul{
    display: flex;
    justify-content: center;
    align-items: center;
    li {
      list-style: none;
      flex: 1;
      height: 50px;
      border-radius: 5px;
      box-sizing: border-box;
      background-color: pink;
      margin: 10px;
      box-shadow: 3px -3px 1px #ccc ;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      span{
          flex: 1;
      }
      span:first-of-type{
          font-size: 20px;
          color: red;
      }
    }
  }
}
</style>
